This function can be used to retrieve the unique camera ID value of the currently active camera.
camera_get_active()
Camera index (real).
var active = camera_get_active();
if active != view_camera[0]
{
view_camera[0] = active;
}
The above code gets the camera ID for the active camera and sets the view camera for port[0] to use it.